
int sockfd = socket(AF_INET, SOCK_STREAM, 0);

struct sockaddr_in addr = {
	    .sin_family = AF_INET,
	        .sin_port = htons(8888),
		    .sin_addr.s_addr = INADDR_ANY
};
bind(sockfd, (struct sockaddr*)&addr, sizeof(addr));

listen(sockfd, 5);

int clientfd = accept(sockfd, NULL, NULL);


char buf[1024];
recv(clientfd, buf, sizeof(buf), 0);
for (int i = 0; buf[i]; i++) buf[i] = toupper(buf[i]);
send(clientfd, buf, strlen(buf), 0);


close(clientfd);
close(sockfd);
